home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Bus / S / S7P 3.6 Manual.sit / S7P 3.6 Manual.rsrc / TEXT_138.txt < prev    next >
Encoding:
Text File  |  1993-11-14  |  5.4 KB  |  95 lines

  1. CreateXAEVT
  2.  
  3. Err:=CreateXAEVT(Class;id;addr;returnID;TransID;aevt)
  4.  
  5. This works exactly like CreateAEVT except it allows you to supply a return ID and/or transaction ID. The return ID will allow you to uniquely identify the reply to this AppleEvent if you allow the reply to be queued and install a handler for ‚Äòaevt‚Äô,‚Äôansr‚Äô. You can allow the return ID to be generated automatically by passing -1 for the return ID. The transaction ID, if non-zero, can be used to specify that a series of AppleEvents are part of a single operation. (Not all applications support this feature.)
  6.  
  7. CopyDesc
  8.  
  9. Result:=CopyDesc(aevt)
  10.  
  11. Creates a duplicate copy of an AppleEvent, AERecord, or target ID. You can use CopyDesc(0) in an AppleEvent handler to obtain a handle to the actual event being processed. This is useful if you wish to write extensions to System 7 Pack‚Ñ¢ which need to access an AppleEvent. When you finish using the result, you must dispose of it by calling DisposeDesc.
  12.  
  13. GetTransactionID
  14. GetReturnID
  15.  
  16. Result:=GetTransactionID(aevt)
  17. Result:=GetReturnID(aevt)
  18.  
  19. Obtains the transaction ID or return ID of an AppleEvent. You can pass 0 to use the AppleEvent currently being processed in an AppleEvent handler procedure. GetReturnID can be used in a handler for queued reply events (class ‚Äòaevt‚Äô,id ‚Äôansr‚Äô) to determine which AppleEvent is being replied to.
  20.  
  21. GetAEInfo
  22.  
  23. Err:=GetAEInfo(Descriptor;Size;Keys;Types;Lengths)
  24.  
  25. Returns arrays of keywords, types, and lengths of each descriptor in an AppleEvent, AERecord, or List. 'Size', a LongInt variable, will be set to the number of descriptors. ‚ÄòKeys‚Äô and ‚ÄòTypes‚Äô should be arrays of String(4) and ‚ÄòLengths‚Äô should be an array of long integers.
  26.  
  27. GetNthDesc
  28.  
  29. Err:=GetNthDesc(aevt,index,key,type,result)
  30.  
  31. Extracts a descriptor from an AppleEvent, AERecord, or List by position rather than by keyword. ‚Äòindex‚Äô tells which descriptor to extract (the first one is 1). ‚Äòkey‚Äô and ‚Äòtype‚Äô will be set to the keyword and actual datatype of that descriptor. ‚Äòresult‚Äô will be a handle to the descriptor. When you finish using it, you must dispose of the result by calling DisposeDesc.
  32.  
  33. GetNthItem
  34.  
  35. Err:=GetNthItem(aevt,index,key,type,textVar)
  36.  
  37. Extracts a value from an AppleEvent, AERecord, or List by position rather than by keyword and coerces the result to text. ‚Äòindex‚Äô tells which descriptor to extract (the first one is 1). ‚Äòkey‚Äô and ‚Äòtype‚Äô will be set to the keyword and actual datatype of that descriptor. This will work for all numeric types and any other data which can be coerced to text. This command, along with GetAEInfo and GetNthDesc can be used to examine an entire AppleEvent and extract the contents of all nested lists.
  38.  
  39. Example:
  40. _________________________________________________________________
  41. --- DumpList
  42. $err:=GetAEInfo ($1;$Size;Keys;Types;Lengths)
  43. For ($i;1;$size)
  44.   MESSAGE($2*"> ")
  45.   $err:=GetNthDesc ($1;$i;$aKey;$aType;$aDesc)
  46.   If (($aType="list")|($aType="reco"))
  47.     MESSAGE($aKey+"   "+$aType+Char(13))
  48.     DumpList ($aDesc;$2+1)
  49.   Else
  50.     $err:=GetNthItem ($1;$i;$aKey;$aType;$value)
  51.     MESSAGE($aKey+"   "+$aType+"   "+$value+Char(13))
  52.   End if
  53.   $err:=DisposeDesc ($aDesc)
  54. End for 
  55. _________________________________________________________________
  56.  
  57. ResetTimer
  58.  
  59. Err:=ResetTimer
  60.  
  61. Resets the AppleEvent manager‚Äôs timer to prevent timing out when responding to an AppleEvent. This command can be used in an AppleEvent handler in 4D 3.0 or later which needs to perform some lengthy processing before it returns a reply. Any non-zero result means that your handler was called with no reply requested or that you‚Äôre not in an AppleEvent handler procedure.
  62.  
  63. ObjX
  64.  
  65. ospec:=ObjX(class;container;value)
  66.  
  67. Creates an object specifier referring to a special object such as All, Any, First, Middle, Last. Value should be one of these 4-character strings: "all ", "any ", "firs", "midd", or "last".
  68.  
  69. Coerce
  70.  
  71. Err:=Coerce(descriptor;type)
  72.  
  73. Allows you to coerce an AERecord to a specific type. For example, you can create an object specifier by coercing a record containing "want", "from", "form", and "seld" descriptors into type "obj ".
  74.  
  75. Comparison
  76.  
  77. ospec:=Comparison(class;container;object1;operator;value)
  78.  
  79. Creates a comparison object descriptor which lets you request something like "All rows where cell 1 contains 'Mike'". Class is the object class we're interested in. Container specifiers the container in which we should search. Object1 is an object specifier describing one operand in the comparison. This object specifier should use -1 as the container, which means "object being examined" and will be an object found within the previously specified container. Operator should be a 4-letter string describing a comparison, such as "cont" for contains, "bgwt" for begins with, "ends" for ends with, or "=   ", ">   ", ">=  " etc. Value should be a text value to be compared against (if necessary, a number string will automatically be coerced to a numeric value).
  80.  
  81. Example:
  82. _________________________________________________________________
  83. $err:=MakeAddress ("FMPR";FileMaker)
  84. If ($err=0)
  85.  ` Show all records (rows) where field (cell) 1 contains "Mike"
  86.  $err:=CreateAEVT ("misc";"mvis";FileMaker;aevt)
  87.  $obj:=Comparison("crow";Obj("docu";0;1);Obj("ccel";-1;1);"cont";"Mike")
  88.  $err:=PutObject (aevt;"----";$obj) ` automatically disposes $obj
  89.  $err:=SendAppleEvent (aevt;reply;kAEWaitReply ;-1)
  90.  $err:=DisposeDesc (aevt)
  91.  $err:=DisposeDesc (reply)
  92.  $err:=DisposeDesc (FileMaker)
  93. End if 
  94. _________________________________________________________________
  95.